package com.java8.time.api;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;

/**
 * <p>Description: [Java 8中如何使用预定义的格式化工具去解析或格式化日期]</p>
 * Created on 2020/2/21
 *
 * @author <a href="mailto: 819712047@qq.com">谢振东 </a>
 * @version 1.0
 */
public class Demo17 {

    public static void master() {
        System.out.println("-----------------Demo17.master()-----------------");
        String dayAfterTommorrow = "20200221";
        LocalDate formatted = LocalDate.parse(dayAfterTommorrow,
                DateTimeFormatter.BASIC_ISO_DATE);
        System.out.println(dayAfterTommorrow + "  格式化后的日期为:  " + formatted);
    }
}
